package cn.pomelo.album.commom;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;

public class Util {

    public static String getName(String str) {
        String name = UUID.randomUUID().toString().replace("-", "");
        return str == "" ? name: str + "-" + name;
    }

    public static String dateName() {
        Date date = new Date();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM");
        return formatter.format(date);
    }

    public static String substringAfter(String url, String separator) {
        if (url == null || url.length() <= separator.length()) {
            return "";
        }
        return url.substring(url.lastIndexOf(separator) + separator.length());
    }

}
